let str = '<div>content1</div><div>content2</div>';
let regexp = /<div>.+?<\/div>/g;
let result = regexp.exec(str);
console.log(result);
result = regexp.exec(str);
console.log(result);